
import com.baosight.ems.core.database.EpRepository;
import ${managerName};

@Component
public class ${managerImplName} extends EpRepository<${modelName}> implements ${managerName} {

    @Override
    protected Class<? extends Mapper> getMapper() {
        return ${mapperName}.class;
    }

    //根据主键查询单个对象
    @Override
    public UserPO getUserPOByPK(<#list primaryKeys  as key>${key.javaType} ${key.javaName}</#list>){
        ${modelName} ${modelName?uncap_first} = new ${modelName}();
        <#list primaryKeys  as key>
        ${modelName?uncap_first}.set${key.javaName?cap_first}(${key.javaName});
        </#list>
        return this.selectOne(${modelName?uncap_first});
    }

    //根据主键删除单个对象
    @Override
    public int deleteUserPOByPK(<#list primaryKeys  as key>${key.javaType} ${key.javaName}</#list>){
        ${modelName} ${modelName?uncap_first} = new ${modelName}();
        <#list primaryKeys  as key>
        ${modelName?uncap_first}.set${key.javaName?cap_first}(${key.javaName});
        </#list>
        return this.delete(${modelName?uncap_first});
    }


    //新增单个对象
    @Override
    public int insert(${modelName} ${modelName?uncap_first}){
        return getMapperBean().insertSelective(${modelName?uncap_first});
    }

    //修改单个对象
    @Override
    public int update${modelName} ${modelName?uncap_first}){
        return this.updateByPrimaryKeySelective(${modelName?uncap_first});
    }
}